<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/style.css"/>
		<link rel="stylesheet" href="../css/iconfont.css" />
		<link rel="stylesheet" href="../css/wallet.css" />
	</head>
<style>
	/*.ka_sn{
		position: absolute;top: 0;left: 0; margin-top: -25px;margin-left: 320px;
	}*/
</style>
	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href="JavaScript:history.go(-1)"></a>
		    <h1 class="mui-title">提现</h1>
		</header>
		<div class="mui-content">
		    <div class="tixian_bank" id="card_list">
		    	<a id="bt-card" href="../member/sq.html">
		    		<div class="tixian_bankimg"><img src="../images/yinlian.gif"></div>
		    		<div class="tixian_bankinfo">
		    			<!--<p id='bank_name'></p>-->
		    			<p class="tix_banknum " ><em id='bank_name'></em></p>
		    			<p class="tix_banknum " ><em id='bank_num'></em></p>
		    		</div>
		    		<div class="clearfix"></div>
		    	</a>
		    	
		    </div>
		    
		    <div class="tixian_pri">
		    	<p>提现金额</p>
		    	<p class="tixian_prinum clearfix">
		    		<label>¥</label>
		    		<input type="text" id="tixian_money" onkeyup="tx()" placeholder="" />
		    	</p>
		    	<p class="tixian_yue" >可用余额<span id="yue">0.00</span> 元&nbsp;&nbsp;&nbsp;（单笔最大可提现额20000元）</p>
		    </div>
		    <div class="pay_paystyle">
		    	<div class="tixian_bank">
					<b><p style="color:black;font-size: 12px;">手续费：<span id="shouxufei"></span></p></b>
					<b><p style="color:black;font-size: 12px;">实际到账：<span id="daozhang"></span></p></b>
				</div>
		     	<div class="tixian_bt">提现通道</div>
				<form class="mui-input-group">
					<div class="mui-input-row mui-radio">
						<label>D+0</label>
						<input name="type" value="1" id="fs1" type="radio" checked>
					</div>
					<div class="mui-input-row mui-radio">
						<label>D+1</label>
						<input name="type" value="2" id="fs2" type="radio" >
					</div>
				</form>
				<div class="tixian_shuom">
					<!--<p>说明：提现结束后，系统对提现金额进行冻结，提现佣金将在于3-7个工作日内发放到银行卡上。（一般转账时间为每月12号左右，遇特殊假日会提前或顺延。）</p>
					<p>如在5号前申请提现，所提现佣金不包括上月佣金，并于申请当月到账；如在7号后申请提现，所提现佣金包括上月佣金，但于申请次月到账</p>-->
					<p>会员通过实名认证及绑定结算银行卡后，可选择D+1进行结算，结算费率为0；申请成功后，该笔提现会在第二个工作日24:00点之前到账。</p>
					<p>同时也可以申请“D+0提现”，结算费率为0，每笔另加2元手续费，申请成功后，该笔营业款会在当日24:00点前到账。</p>
					<p>各通道限额以银行限额为准，以上费率及限额仅供参考，我司保留根据国家政策及第三方支付相关规定进行调整的权利。</p>
				</div>
			</div>
			<button class="wallet_btn" onclick="submit_tx()"  style="width: 100%;color: #fff;">确认</button>
		    <!--<div class="wallet_btn" id='queren'><lable>确认</lable></div>-->
		</div>
		
	</body>

</html>
<script src="../js/mui.min.js"></script>
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script type="text/javascript" src="../js/bootstrap-datepicker.js"></script>
	<script src="../js/layer/layer.min.js"></script>
	<script src="../js/castapp.js"></script>

	<script src="../js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../js/date.js"></script>
		<script src="../js/app.js"></script>
	
<script>
	var html='各位龙信云小伙伴，国庆假期将至，根据国家法定假期的规定，并结合公司实际情况，现对国庆放假做出安排，具体如下：'+            
'一、放假时间'+
'2017年10月1日（周日）至10月5日（周四）共5天。10月6日（周五）正常上班。'  +  
'放假期间如有紧急问题请拨打龙信云商学院值班电话：'+
'结算时间'+
'银行：国庆期间，到账时间（D+0秒到），到账时间（T+1）统一延迟至10月6日结算';
	//layer.msg(html,{icon:6,time:5000,area: ['20rem', '12rem']});
	//显示银行卡和可用余额
		$(function() {
			$.ajax({
				//type: 'post',
				url: APP.api_url + 'wallet/get_bankcard',
				data: {
					token	: get_token(),
					uid 	: getUid()
				},
				success: function(data) {
					if(data.code == 200) {
						var member = data.data;
						localStorage.setItem('member', JSON.stringify(member));
						$('#bank_name').text(member['bank_account']);
						$('#bank_num').text(member['card_no']);
						$('#yue').text(member['credit2']);
						
					}else if(data.code == 408){
						layer.msg('请先实名认证', {
						  time: 1000 //2秒关闭（如果不配置，默认是3秒）
						}, function(){
							location.href = '/../member/sq.html';
						});
					}else{
						console.log(data.msg);
					}
				}
			})
		});
</script>
<script>
function submit_tx(){
		$('.wallet_btn').attr("disabled",true);
	   // var ka_sn = $('input:radio[name="ka_sn"]:checked').val();
	   var obj = $('input:radio[name="type"]:checked').val();
		var tixian_money =$("#tixian_money").val();
		var yue=$("#yue").text();
		if(tixian_money ==""){
			layer.msg("请输入提现金额");
			$('.wallet_btn').attr("disabled",false);
			return false;
		}
		if(parseInt(tixian_money) > parseInt(yue)){
			layer.msg("余额不足");
			return false;
			
		}
		if(parseFloat(tixian_money)<10){
			layer.msg("提现金额不能小于10元");
			$('.wallet_btn').attr("disabled",false);
			return false;
		}
		if(parseFloat(tixian_money)>20000&&obj==2){
			layer.msg("D+1方式提现金额最多可提现20000元");
			$('.wallet_btn').attr("disabled",false);
			return false;
		}
		
		if(parseFloat(tixian_money)>1000&&obj==1){
			layer.msg("D+0方式提现金额不能大于1000元");
			$('.wallet_btn').attr("disabled",false);
			return false;
		}
		$.ajax({
				url: APP.api_url + 'Wallet/tixian',
				data: {
					token			: get_token(),
					uid				: getUid(),
					tixian_money	: tixian_money,
					type			: obj,
				},
				success: function(data) {
					if(data.code == 200) {
						layer.msg('申请提现成功！', {
						  time: 2000 
						}, function(){
							location.href="tixian_record.html";
						});
						
					}else{
						layer.msg(data.msg);
						console.log(data.msg);
					}
				}
			})
				
		}
		function tx(){	
			var obj = $('input:radio[name="type"]:checked').val();
			var tixian_money=$('#tixian_money').val();//输入金额
			if(obj==1){
				//var shouxufei=(tixian_money*0.0065).toFixed(2);
				var shouxufei = 0;
				$("#shouxufei").text(shouxufei);
				$("#daozhang").text((tixian_money-shouxufei-2).toFixed(2)+"(手续费2元)");
			}else if(obj==2){
				//var shouxufei=(tixian_money*0.006).toFixed(2);
				var shouxufei = 0
				$("#shouxufei").text(shouxufei);
				$("#daozhang").text(tixian_money-shouxufei);
			}
		}
		$("#fs1").click(function(){
			tx();
		});
		$("#fs2").click(function(){
			tx();
		});
</script>
